package com.luxury.adpter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.luxury.R;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2016/12/23.
 */

public class ProductGridViewAadapter extends BaseAdapter {
    private Context mContext = null;
    private List<String> mList = null;
    private LayoutInflater mInflater = null;

    public ProductGridViewAadapter(Context mContext, List<String> mList) {
        this.mContext = mContext;
        this.mList = mList;
        this.mInflater = (LayoutInflater) mContext.getSystemService(Context
                .LAYOUT_INFLATER_SERVICE);
    }

    @Override
    public int getCount() {
        return mList.size();
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View convertView, ViewGroup viewGroup) {
        View view = mInflater.inflate(R.layout.item_gv_product, viewGroup, false);
        ViewHolder h=new ViewHolder(view);
        h.tv_ItemGridViewProduct.setText(mList.get(i));
        return view;
    }

    public static class ViewHolder {
        @BindView(R.id.tv_itemGridView_product)
        TextView tv_ItemGridViewProduct;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
